DR='N:'
F1='DRUGS'
F2='DISPOS'
SELE 1
SET EXCLU OFF
USE &DR&F1
SELE 2
SET EXCLU OFF
USE &DR&F2
SELE 1
CLEA
DO ADDRESSC
@  5,  3  TO  7, 51    DOUBLE
@  6,  5  SAY "PRINT/DISPLAY LIST OF REORDER STOCK"
TMP='P'
do choice with 12,33,'Printer/Display/Quit','PDQ',tmp
do case
   case tmp='Q'
        close data
        close index
        return

   case tmp='D'
        tampil=savescreen(0,0,24,79)
        go top
        SET COLO TO BG+/B,w+/n
        clea
        @ 01,00 TO 01,79 DOUBLE
        @ 03,00 TO 03,79 DOUBLE
        @ 02,  1  SAY "CODE     DESCRIPTION AND PACKAGING                 REFILL   ACTUAL   SUGGESTED"
        ***@ 11, 50  SAY "LEVEL     LEVEL     RE-ORDER"
        BR=3
        klr='N'
        sele 1
        go top
        LOCATE FOR ST_ACT_BUY<ST_REFIL .AND. ST_REORDER=.F. .AND. ST_RE_PROP=.T.
        DO WHILE .T.
         IF FOUND()
           AREA='1'
           KODE=DRUG_CODE
           NAME=DRUG_NAME
           UNIT=DRUG_UNIT
           TIPE=DRUG_TYPE
           QANT=DRUG_QANT
           BUYUNIT=BUY_UNIT
           DO PURC_D1
         ELSE
           SELE 2
           LOCATE FOR ST_ACT_BUY<ST_REFIL .AND. ST_REORDER=.F. .AND. ST_RE_PROP=.F.
           DO WHILE .T.
              IF FOUND()
                 AREA='2'
                 KODE=DISP_CODE
                 NAME=DISP_NAME
                 UNIT=DISP_UNIT
                 TIPE=DISP_TYPE
                 QANT=DISP_QANT
                 BUYUNIT=BUY_UNIT
                 DO PURC_D1
              else
                 klr='Y'
                 exit
              endif
              IF KLR='Y'
                 EXIT
              ENDIF
              continue
           enddo
         ENDIF
         if klr='Y'
            exit
         endif
         CONTINUE
        ENDDO
        DO DISP_MSG WITH 'PRESS ANY KEY'

        RESTSCREEN(0,0,24,79,TAMPIL)


   CASE TMP='P'
        KLR='N'
        DO SET_DEV
        IF KLR='Y'
           CLOSE DATA
           CLOSE INDEX
           RETURN
        ENDIF
        br=100
        fl=0
        hl=0
        ttl=0
        store 0 to ttl1,ttl2,ttl3,ttl4,ttl5
        set devi to print
        @ 0,0 say chr(18) pict 'x'
        SELE 1
        go top
        LOCATE FOR ST_ACT_BUY<ST_REFIL .AND. ST_REORDER=.F. .AND. ST_RE_PROP=.T.
        DO WHILE .T.
         IF FOUND()
           AREA='1'
           KODE=DRUG_CODE
           NAME=DRUG_NAME
           UNIT=DRUG_UNIT
           TIPE=DRUG_TYPE
           QANT=DRUG_QANT
           BUYUNIT=BUY_UNIT
           DO PURC_D2
         ELSE
           SELE 2
           LOCATE FOR ST_ACT_BUY<ST_REFIL .AND. ST_REORDER=.F. .AND. ST_RE_PROP=.F.
           DO WHILE .T.
              IF FOUND()
                 AREA='2'
                 KODE=DISP_CODE
                 NAME=DISP_NAME
                 UNIT=DISP_UNIT
                 TIPE=DISP_TYPE
                 QANT=DISP_QANT
                 BUYUNIT=BUY_UNIT
                 DO PURC_D2
              else
                 klr='Y'
                 exit
              endif
              continue
           enddo
         ENDIF
         if klr='Y'
            exit
         endif
         CONTINUE
        ENDDO
        EJECT
        @ 0,0 SAY CHR(18) PICT 'X'
        SET DEVI TO SCREEN

ENDCASE
CLOSE DATA
CLOSE INDEX
RETURN